package cn.xhy.material.dal.mysql.pojectinfo;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.xhy.material.controller.admin.pojectinfo.vo.PojectInfoPageReqVO;
import cn.xhy.material.dal.dataobject.pojectinfo.PojectInfoDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 项目信息 Mapper
 *
 * @author xhy
 */
@Mapper
public interface PojectInfoMapper extends BaseMapperX<PojectInfoDO> {

    default PageResult<PojectInfoDO> selectPage(PojectInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PojectInfoDO>()
                .likeIfPresent(PojectInfoDO::getProjectName, reqVO.getProjectName())
                .eqIfPresent(PojectInfoDO::getPhone, reqVO.getPhone())
                .betweenIfPresent(PojectInfoDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(PojectInfoDO::getHead, reqVO.getHead())
                .orderByDesc(PojectInfoDO::getId));
    }

}
